/*
 * SPDX-FileCopyrightText: 2023 HAW Hamburg
 * SPDX-License-Identifier: LGPL-2.1-only
 */

#pragma once

/**
 * @ingroup
 * @defgroup       <name> <description>
 * @{
 *
 * @file        tests_psa_cbor_enc_dec.h
 * @brief
 *
 * @author      Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
 *
 */

#include <stdint.h>
#include "embUnit.h"

#ifdef __cplusplus
extern "C" {
#endif

#define TEST_ASSERT_PSA(func_) TEST_ASSERT_MESSAGE((func_) == PSA_SUCCESS, #func_ " failed");

#define ECC_KEY_SIZE (256)
#define ECC_KEY_TYPE (PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1))
#define ECC_ALG_HASH (PSA_ALG_SHA_256)
#define ECC_ALG (PSA_ALG_ECDSA(ECC_ALG_HASH))

static const uint8_t privkey[] = {
    0x27, 0xfc, 0x4d, 0x41, 0xf3, 0xde, 0x49, 0xf7,
    0x86, 0x31, 0x4b, 0x74, 0xaa, 0x67, 0xde, 0x4b,
    0xa9, 0x61, 0xc3, 0x8f, 0x4f, 0x89, 0x6f, 0x04,
    0x5a, 0x53, 0x71, 0x02, 0xb4, 0x3d, 0x20, 0x39
};

static const uint8_t pubkey[] = {
    0x04,
    0x56, 0xcb, 0x81, 0xd1, 0xcb, 0xde, 0x44, 0xf5,
    0x1d, 0xcc, 0xb1, 0x26, 0x02, 0x67, 0x0d, 0x76,
    0xdd, 0xe7, 0x84, 0xed, 0x8d, 0x30, 0x72, 0x1c,
    0xca, 0x50, 0x59, 0xf9, 0x20, 0xad, 0x62, 0x87,
    0x74, 0x9e, 0xc9, 0xcb, 0x26, 0x75, 0xc5, 0x1b,
    0x69, 0xa6, 0x89, 0x56, 0x10, 0x2e, 0x8f, 0x6f,
    0x72, 0x57, 0xb9, 0xb9, 0x93, 0xed, 0x88, 0x99,
    0xea, 0xfd, 0x53, 0x82, 0x3d, 0xca, 0xb6, 0x41
};

static const uint8_t AES_KEY[] = {
    0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0x18,
    0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c
};

Test* tests_psa_crypto_enc_dec_single_key(void);
Test* tests_psa_crypto_enc_dec_keypair(void);
Test* tests_psa_crypto_enc_dec_protected_key(void);

#ifdef __cplusplus
}
#endif

/** @} */
